/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */
package com.coworkboard.store;

import com.google.appengine.api.datastore.DatastoreService;
import com.google.appengine.api.datastore.DatastoreServiceFactory;
import com.google.appengine.api.datastore.Entity;
import com.google.appengine.api.datastore.Query;
import com.google.appengine.api.datastore.Text;

/**
 *
 * @author xavier
 */
public class PageStore {

    public void storePage(String title, String content, String blobkey) {
        DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

        Entity entity = new Entity("Page");
        entity.setProperty("title", title);
        entity.setProperty("content", new Text(content));
        entity.setProperty("image", blobkey);
        
        datastore.put(entity);
    }

    public void storePage(String title, String content) {
DatastoreService datastore = DatastoreServiceFactory.getDatastoreService();

        Entity entity = new Entity("Page");
        entity.setProperty("title", title);
        entity.setProperty("content", new Text(content));

        datastore.put(entity);    }
}
